Pooling in a hierarchical temporal memory based system

ABSTRACT

A hierarchy of computing modules is configured to learn a cause of input data sensed over space and time, and is further configured to determine a cause of novel sensed input data dependent on the learned cause. The hierarchy is further configured to associate a first pattern in the input data and a second pattern in the input data to a same possible cause of the input data.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is a continuation, under 35 U.S.C. § 120, ofU.S. patent application Ser. No. 11/351,437, filed on Feb. 10, 2006 andentitled “Architecture of a Hierarchical Temporal Memory Based System”.Further, the present application claims priority, under 35 U.S.C. § 119,of U.S. Provisional Patent Application No. 60/771,990, filed on Feb. 10,2006 and entitled “Hierarchical Temporal Memory”. Further, the presentapplication contains subject matter that may be related to subjectmatter described in one or more of the following commonly ownedapplications: U.S. patent application Ser. No. 11/010,243, filed on Dec.10, 2004 and entitled “Methods, Architecture, and Apparatus forImplementing Machine Intelligence and Hierarchical Memory Systems”; andU.S. patent application Ser. No. 11/147,069, filed on Jun. 6, 2005 andentitled “Trainable Hierarchical Memory System and Method”.

BACKGROUND

Generally, a “machine” is a system or device that performs or assists inthe performance of at least one task. Completing a task often requiresthe machine to collect, process, and/or output information, possibly inthe form of work. For example, a vehicle may have a machine (e.g., acomputer) that is designed to continuously collect data from aparticular part of the vehicle and responsively notify the driver incase of detected adverse vehicle or driving conditions. However, such amachine is not “intelligent” in that it is designed to operate accordingto a strict set of rules and instructions predefined in the machine. Inother words, a non-intelligent machine is designed to operatedeterministically; should, for example, the machine receive an inputthat is outside the set of inputs it is designed to recognize, themachine is likely to, if at all, generate an output or perform work in amanner that is not helpfully responsive to the novel input.

In an attempt to greatly expand the range of tasks performable bymachines, designers have endeavored to build machines that are“intelligent,” i.e., more human- or brain-like in the way they operateand perform tasks, regardless of whether the results of the tasks aretangible. This objective of designing and building intelligent machinesnecessarily requires that such machines be able to “learn” and, in somecases, is predicated on a believed structure and operation of the humanbrain. “Machine learning” refers to the ability of a machine toautonomously infer and continuously self-improve through experience,analytical observation, and/or other means.

Machine learning has generally been thought of and attempted to beimplemented in one of two contexts: artificial intelligence and neuralnetworks. Artificial intelligence, at least conventionally, is notconcerned with the workings of the human brain and is instead dependenton algorithmic solutions (e.g., a computer program) to replicateparticular human acts and/or behaviors. A machine designed according toconventional artificial intelligence principles may be, for example, onethat through programming is able to consider all possible moves andeffects thereof in a game of chess between itself and a human.

Neural networks attempt to mimic certain human brain behavior by usingindividual processing elements that are interconnected by adjustableconnections. The individual processing elements in a neural network areintended to represent neurons in the human brain, and the connections inthe neural network are intended to represent synapses between theneurons. Each individual processing element has a transfer function,typically non-linear, that generates an output value based on the inputvalues applied to the individual processing element. Initially, a neuralnetwork is “trained” with a known set of inputs and associated outputs.Such training builds and associates strengths with connections betweenthe individual processing elements of the neural network. Once trained,a neural network presented with a novel input set may generate anappropriate output based on the connection characteristics of the neuralnetwork.

SUMMARY

According to at least one aspect of one or more embodiments of thepresent invention, a system includes a hierarchy of computing modulesconfigured to learn a cause of input data sensed over space and time,where the hierarchy is further configured to determine a cause of novelsensed input data dependent on the learned cause, and where thehierarchy is further configured to associate a first pattern in theinput data and a second pattern in the input data to a same possiblecause of the input data.

According to at least one other aspect of one or more embodiments of thepresent invention, a computer-implemented method of performingoperations includes learning a cause of a first set of input datareceived over space and time by a hierarchy of computing modules, wherethe hierarchy is capable of determining a cause of a second set of inputdata dependent on the learned cause, and where the learning includesassociating a first pattern in the first set of input data and a secondpattern in the first set of input data to a same possible cause of thefirst set of input data.

According to at least one other aspect of one or more embodiments of thepresent invention, a computer-readable medium having instructionstherein that are executable by a processor to learn a cause of a firstset of input data received over space and time by a hierarchy ofcomputing modules, where the hierarchy is capable of determining a causeof a second set of input data dependent on the learned cause, and wherethe instructions to learn comprises instructions to associate a firstpattern in the first set of input data and a second pattern in the firstset of input data to a same possible cause of the first set of inputdata.

The features and advantages described herein are not all inclusive, and,in particular, many additional features and advantages will be apparentto those skilled in the art in view of the following description.Moreover, it should be noted that the language used herein has beenprincipally selected for readability and instructional purposes and maynot have been selected to circumscribe the present invention.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a flow of data between an object and a human.

FIG. 2 shows an HTM in accordance with an embodiment of the presentinvention.

FIG. 3 shows a node in accordance with an embodiment of the presentinvention.

FIG. 4 shows a flow process in accordance with an embodiment of thepresent invention.

FIG. 5 shows an operation of a sequence learner in accordance with anembodiment of the present invention.

FIG. 6 shows a flow process in accordance with an embodiment of thepresent invention.

FIGS. 7A-7E show representations in accordance with an embodiment of thepresent invention.

FIG. 8 shows a representation in accordance with an embodiment of thepresent invention.

FIG. 9 shows a representation in accordance with an embodiment of thepresent invention.

FIG. 10 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 11 shows a flow process in accordance with an embodiment of thepresent invention.

FIG. 12 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 13 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 14 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 15 shows a flow process in accordance with an embodiment of thepresent invention.

FIG. 16 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 17 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 18 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 19 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 20 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 21 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 22 shows an inheritance diagram in accordance with an embodiment ofthe present invention.

FIG. 23 shows a flow process in accordance with an embodiment of thepresent invention.

FIG. 24 shows a flow process in accordance with an embodiment of thepresent invention.

FIG. 25 shows a flow process in accordance with an embodiment of thepresent invention.

FIG. 26 shows at least a portion of an HTM-based system in accordancewith an embodiment of the present invention.

FIG. 27 shows a computer system in accordance with an embodiment of thepresent invention.

Each of the figures referenced above depict an embodiment of the presentinvention for purposes of illustration only. Those skilled in the artwill readily recognize from the following description that one or moreother embodiments of the structures, methods, and systems illustratedherein may be used without departing from the principles of the presentinvention.

DETAILED DESCRIPTION

In the following description of embodiments of the present invention,numerous specific details are set forth in order to provide a morethorough understanding of the present invention. However, it will beapparent to one skilled in the art that the present invention may bepracticed without one or more of these specific details. In otherinstances, well-known features have not been described in detail toavoid unnecessarily complicating the description.

Humans understand and perceive the world in which they live as acollection—or more specifically, a hierarchy—of objects. An “object” isat least partially defined as having some persistent structure overspace and/or time. For example, an object may be a car, a person, abuilding, an idea, a word, a song, or information flowing in a network.

Moreover, referring to FIG. 1, an object in the world 10 may also bereferred to as a “cause” in that the object causes particular data to besensed, via senses 12, by a human 14. For example, the smell (sensedinput data) of a rose (object/cause) results in therecognition/perception of the rose. In another example, the image(sensed input data) of a dog (object/cause) falling upon a human eyeresults in the recognition/perception of the dog. Even as sensed inputdata caused by an object change over space and time, humans want tostably perceive the object because the cause of the changing sensedinput data, i.e., the object itself, is unchanging. For example, theimage (sensed input data) of a dog (object/cause) falling upon the humaneye may change with changing light conditions and/or as the human moves;yet, however, the human is able to form and maintain a stable perceptionof the dog.

In embodiments of the present invention, learning causes and associatingnovel input with learned causes are achieved using what may be referredto as a “hierarchical temporal memory” (HTM). An HTM is a hierarchicalnetwork of interconnected nodes that individually and collectively (i)learn, over space and time, one or more causes of sensed input data and(ii) determine, dependent on learned causes, likely causes of novelsensed input data. HTMs, in accordance with one or more embodiments ofthe present invention, are further described below with reference toFIGS. 2-27.

HTM Structure

An HTM has several levels of nodes. For example, as shown in FIG. 2, HTM20 has three levels L1, L2, L3, with level L1 being the lowest level,level L3 being the highest level, and level L2 being between levels L1and L3. Level L1 has nodes 22, 24, 26, 28; level L2 has nodes 30, 32,and level L3 has node 34. The nodes 22, 24, 26, 28, 30, 32, 34 arehierarchically connected in a tree-like structure such that each nodemay have several children nodes (i.e., nodes connected at a lower level)and one parent node (i.e., node connected at a higher level). Each node22, 24, 26, 28, 30, 32, 34 may have or be associated with a capacity tostore and process information. For example, each node 22, 24, 26, 28,30, 32, 34 may store sensed input data (e.g., sequences of patterns)associated with particular causes. Further, each node 22, 24, 26, 28,30, 32, 34 may be arranged to (i) propagate information “forward” (i.e.,“up” an HTM hierarchy) to any connected parent node and/or (ii)propagate information “back” (i.e., “down an HTM hierarchy) to anyconnected children nodes.

Inputs to the HTM 20 from, for example, a sensory system, are suppliedto the level L1 nodes 22, 24, 26, 28. A sensory system through whichsensed input data is supplied to level L1 nodes 22, 24, 26, 28 mayrelate to commonly thought-of human senses (e.g., touch, sight, sound)or other human or non-human senses.

The range of sensed input data that each of the level L1 nodes 22, 24,26, 28 is arranged to receive is a subset of an entire input space. Forexample, if an 8×8 image represents an entire input space, each level L1node 22, 24, 26, 28 may receive sensed input data from a particular 4×4section of the 8×8 image. Each level L2 node 30, 32, by being a parentof more than one level L1 node 22, 24, 26, 28, covers more of the entireinput space than does each individual level L1 node 22, 24, 26, 28. Itfollows that in FIG. 2, the level L3 node 34 covers the entire inputspace by receiving, in some form, the sensed input data received by allof the level L1 nodes 22, 24, 26, 28. Moreover, in one or moreembodiments of the present invention, the ranges of sensed input datareceived by two or more nodes 22, 24, 26, 28, 30, 32, 34 may overlap.

While HTM 20 in FIG. 2 is shown and described as having three levels, anHTM in accordance with one or more embodiments of the present inventionmay have any number of levels. Moreover, the hierarchical structure ofan HTM may be different than that shown in FIG. 2. For example, an HTMmay be structured such that one or more parent nodes have three childrennodes as opposed to two children nodes like that shown in FIG. 2.Further, in one or more embodiments of the present invention, an HTM maybe structured such that a parent node in one level of the HTM has adifferent number of children nodes than a parent node in the same oranother level of the HTM. Further, in one or more embodiments of thepresent invention, an HTM may be structured such that a parent nodereceives input from children nodes in multiple levels of the HTM. Ingeneral, those skilled in the art will note that there are various andnumerous ways to structure an HTM other than as shown in FIG. 2.

Any entity that uses or is otherwise dependent on an HTM as, forexample, described above with reference to FIG. 2 and below withreference to FIGS. 3-27, may be referred to as an “HTM-based” system.Thus, for example, an HTM-based system may be a machine that uses anHTM, either implemented in hardware or software, in performing orassisting in the performance of a task.

Learning Causes

In embodiments of the present invention, an HTM discovers one or morecauses in its world from sensory input data received by the HTM. Inother words, an HTM does not necessarily have a sense particular to eachof the types of causes being sensed; instead, an HTM may discover fromraw sensed input data that causes such as cars and words exist. In sucha manner, an HTM is able to learn and form representations of causesexisting in its world.

As described above, an “object” has persistent structure. The persistentstructure causes persistent patterns to be sensed by an HTM. Each sensedinput pattern has a spatial attribute. In other words, each sensed inputpattern may be thought of as being represented as a particular set ofbits. In general, a node in an HTM “learns,” i.e., stores and associateswith a common cause, sensed input patterns by determining “coincidences”of sensed input patterns in its input. Determining coincidences ofsensed input patterns involves determining which sensed input patternsare active at the same time at a rate statistically greater than whatwould be expected based on mere chance. For example, if an HTM nodehaving one hundred inputs has seven inputs that become active togetherat some statistically significant rate, then the HTM node learns thesensed input patterns at those seven inputs.

Further, in one or more embodiments of the present invention, it may notbe necessary for an HTM node to learn all sensed input patternsoccurring together at some statistically significant rate. Instead, anHTM node may store the x most common sensed input patterns found in itsinput. These learned sensed input patterns may be referred to as“quantization points” of the HTM node.

In addition to an HTM node learning commonly occurring sensed inputpatterns as described above, the HTM node learns common sequences ofthose learned sensed input patterns. A particular sequence of learnedsensed input patterns may be learned by recognizing that the sequenceoccurs at a rate statistically greater than what would be expected basedon mere chance. For example, if of fifty sensed input patterns learnedby an HTM node, three occur in a particular order at some statisticallysignificant rate, then the HTM node may learn that sequence of sensedinput patterns.

Further, in one or more embodiments of the present invention, it may notbe necessary for an HTM node to learn all sequences occurring at somestatistically significant rate. Instead, an HTM node may store the xmost frequent sequences found in its input.

In one or more embodiments of the present invention, the sequenceslearned by an HTM node may each be represented by a variable. As eachlearned sequence is associated with a particular cause, each variableaccordingly represents a different cause. The HTM node may pass each ofits variables up to a parent node via a vector containing probabilitiesas to the likelihood that each of its learned sequences is active at itsinput at a given time. The parent node may then (i) determinecoincidences of its sensed input patterns (i.e., the variables receivedfrom its child node), (ii) learn sensed input patterns as describedabove, and (iii) learn sequences of learned sensed input patterns (i.e.,learn sequences of variables representing sequences learned by its childnode).

Sequence Learning

As described above, sequence learning involves learning frequentlyoccurring sequences of elements and outputting a probability that agiven input vector of elements is part of a learned sequence for each ofits learned sequences. FIG. 3 shows a node 40 having a sequence learningfunctionality. The node 40 has a coincidence detector 42 and a sequencelearner 44. The coincidence detector 42 receives some input 46.Generally, the coincidence detector 42 identifies coincidences among itsinput. At each time-step, the coincidence detector 42 outputs adistribution P(e⁻ _(t)|y), where P(e⁻ _(t)|y) represents the probabilityof observing e⁻ (evidence from a lower level) at time t when in state y.The distribution P(e⁻ _(t)|y) is a vector in which each entrycorresponds to a different y, where y represents some state of a worldto which node 40 is exposed. Thus, for example, at time t, the firstentry in P(e⁻ _(t)|y) is P(e⁻ _(t)|y₁), the second entry is P(e⁻_(t)|y₂), and so forth.

Based on the distributions outputted over time by the coincidencedetector 42, the sequence learner 44 outputs a distribution P(e⁻_(t)|S), where P(e⁻ _(t)|S) represents the probability of observing e⁻(evidence from a lower level) at time t over learned sequences S. Thus,each entry in the distribution P(e⁻ _(t)|S) corresponds to a differentlearned sequence S_(i). In one or more embodiments of the presentinvention, the learned sequences themselves may not be communicatedoutside of the sequence learner 44. Further, those skilled in the artwill note that the sequence learner 44, has a behavior (i.e., outputtingdistributions over learned sequences) that may be independent of a typeand/or topology of network of which the sequence learner 44 is part.

As described above, y represents some state of a world. Those skilled inthe art will note that the statistical nature of the world is such thatthese states are likely to occur in particular sequences over time. Asshown in FIG. 4, to learn sequences in its world, a sequence learner(e.g., 44 in FIG. 3) identifies sequences and updates them over timeST50. Further, the sequence learner is arranged to collect statistics onits learned sequences ST52 and then, based on its learned sequences andstatistics thereof, compute probability distributions (as describedabove) ST54.

In one or more embodiments of the present invention, a sequence learnermay have a particular number noutputs of outputs. Although the sequencelearner may identify more sequences than it has outputs, only noutputsmay be represented at the output of the sequence learner. In otherwords, every sequence identified by the sequence learner may not beuniquely represented at the output of the sequence learner. Thus, itfollows that the sequence learner may be arranged to allocate, or “map,”its limited number of outputs among a larger number of identifiedsequences. In one or more embodiments of the present invention, suchmapping may be motivated by one or more of the following priorities:desiring frequently occurring sequences; desiring differentiatedsequences (in an effort to, for example, not waste outputs on sequencesthat are substantially similar); and desiring a minimum disruption tothe meanings associated with the outputs (in an effort to, for example,enable stable learning at a higher level).

In regard to identifying frequently occurring sequences, at any giventime t, a sequence learner may have to calculate the probability that aparticular sequence of elements has been received over time up untiltime t. For example, to determine the probability that the sequence‘y₄y₂y₃’ has occurred over the last three samples (i.e., over the lastthree time steps), a sequence learner may multiply P(e⁻ _(t-2)|y₄), P(e⁻_(t-1)|y₂), and P(e⁻ _(t)|y₃) as shown in FIG. 5. The product of such amultiplication operation represents a “soft” count of the probability ofhaving observed ‘y₄y₂y₃’. Thus, because at every time t, each inputstate has some probability associated with it (e.g., in FIG. 5, at anytime t, each of input states y₁-y₄ has an associated probability), forevery time t, there is some probability that any one of the possiblesequences has been observed.

Further, in one or more embodiments of the present invention, instead ofkeeping a “soft” count as described above, a count of the actual numberof times a sequence has occurred—a “hard” count—may be kept dependent onhaving a particular state of input vectors.

Those skilled in the art will note that there may be a combinatorialexplosion of possible sequences received by a sequence learner overtime. Thus, in one or more embodiments of the present invention, thesequence learner may consider a certain number of input states in eachinput sample, where that certain number is parameterized by some valuepara. Such treatment may narrow the number of possible updates to a baseof para instead of a base of the number ninputs of inputs to thesequence learner.

Further, in one or more embodiments of the present invention, a searchspace of a sequence learner may be reduced, or otherwise controlled, byconsidering only those sequences of a given length that have beenidentified as potentially frequent from observations of shortersequences. For example, the sequence learner may count likely2-sequences (i.e., sequences of 2 elements) over a certain numberwindow[2] of input samples. The resulting frequent 2-sequences may beused to generate candidate 3-sequences (i.e., sequences of 3 elements),whereupon, only these candidate 3 sequences are counted over a certainnumber window[3] of input samples. This process may continue untilreaching a number MaxL representing the maximum length sequence to beconsidered by the sequence learner. In one or more other embodiments ofthe present invention, the sequence learner may have a differentstopping point. For example, the sequence learner may use the statisticsof its input to determine the maximum sequence length to consider.

Determining likely sequences as described above may be dependent on a“coherence time,” which is the time over which the statistics of inputsremain constant. For an “on-line” sequence learner (i.e., one that doesnot loop back over previous inputs), the time required to generatelikely sequences up to some maximum length may have to be less than thecoherence time. If the time required to identify sequences of a certainlength becomes longer than the coherence time, then in one or moreembodiments of the present invention, “batch” processing, instead ofon-line processing, may be used. Batch processing may involveidentifying k-sequences (i.e., sequences of length k) by looping backover the same input used to identify the k−1-sequences (i.e., sequencesof length k−1).

In one or more embodiments of the present invention, as sequences ofcertain length are identified, a sequence learner may keep theassociated counts in a table st_table. There may be a separate st_tablefor each sequence length. For example, after counting 3-sequences, atable st_table{3} may be as follows:

Count Sequence 103.92 121 8.67 224 82.50 231 167.02 312 220.45 423 14.32412

FIG. 6 shows a flow process for building a table st_table in accordancewith an embodiment of the present invention. In regard to building tablest_table {k}, for each k-sequence received in an input to a sequencelearner, if a certain number window [k] of input samples has not yetbeen sampled ST60, the table st_table{k} is searched for the k-sequenceST62, ST64. If the k-sequence is already identified by tablest_table{k}, then the corresponding count is appropriately incrementedby the soft count for the k-sequence ST66, ST68. Otherwise, if thek-sequence is not listed in table st_table {k}, then that k-sequence isadded to table st_table {k} with its corresponding soft count ST66,ST70. Upon receiving window[k] input samples ST60, the least commonk-sequences may be removed ST72, i.e., all but the top x sequences maybe removed, where x represents a maximum number of sequences that may bekept in table st_table {k} after counting sequences of length k. Theresulting table st_table{k} may then be used to generate candidatesequences for table st_table{k+1} (generating candidate sequencesfurther described below) ST73, whereupon the process shown in FIG. 6 maybe repeated for table st_table{k+1}. Further, in one or more embodimentsof the present invention, the process shown in FIG. 6 may not beperformed for every k-sequence.

Further, in one or more embodiments of the present invention, it may bedesirable to refine counts on k-length sequences at multiple points intime after an initial counting procedure. In such embodiments, in aneffort to give greater weight to recent counts without abandoning allprevious observations, a table lt_table of long-term counts may becreated and used.

As described above, in one or more embodiments of the present invention,a sequence learner may only consider those sequences of a given lengththat have been identified as potentially frequent from observations ofshorter sequences. In other words, for example, if S_(i) is a frequent3-sequence, then it is likely that each subsequence of S_(i) of length 2is also frequent. Conversely, if a 2-sequence is infrequent, then it isunlikely that any of its 3-length super-sequences are frequent. Thus,the sequence learner may consider only those 3-sequences of which each2-length subsequence is frequent.

In one or more embodiments of the present invention, a sequence learnermay determine candidate k-sequences from a set of frequent k−1-sequencesusing, for example, a “join” operation. Candidate k-sequences are thosefor which the first k−1 samples and the last k−1 samples are frequent.For each frequent k−1-sequence S_(i) in a table st_table{k−1}, a joinoperation may search for a k−1-sequence S_(j) in table st_table{k−1},where the first k−2 elements of S_(j) are the same as the last k−2elements of S_(i). If such an S_(j) exists, the concatenation of S_(i)and the last element of S_(j) is added to the list of candidatek-sequences in a table st_table{k}. For example, consider the followingtables st_table{3} and st_table{4}, which show the results after a joinoperation on table st_table{3}.

To illustrate how a join operation may work on table st_table{3}, thefollowing description is provided. Taking the 3-sequence ‘121,’ the joinoperation searches table st_table{3} for a 3-sequence whose first 2elements match the last two elements of the taken ‘121’ 3-sequence.Because there are no 3-sequences that meet this condition with respectto the taken ‘121’ 3-sequence, the join operation may next take, forexample, the 3-sequence ‘312.’ For this taken sequence, the joinoperation finds that the first two elements of the ‘121’ 3-sequencematches the last two elements of the taken ‘312’ sequence. Thus, thejoin operation then concatenates the taken ‘312’ 3-sequence with thelast element in the found ‘121’ 3-sequence to yield a candidate4-sequence of ‘3121’ in table st_table{4}. Further, those skilled in theart will note that in one or more embodiments of the present invention,one or more operations other than a join operation may be used togenerate candidate k-sequences.

As described above, in one or more embodiments of the present invention,each output of a sequence learner represents a particular learnedsequence. Considering that the sequence learner is continuouslyidentifying the most likely sequences to represent at its outputs, oldsequences may need to be replaced by newer sequences that are morefrequent. If there are multiple old sequences that are less frequentthan a new sequence, the sequence learner may replace one or more of themultiple old sequences based on some criteria. For example, the sequencelearner may first remove any old sequences having a length of 1.

Further, the sequence learner may, for example, remove an old sequencebased on its similarity to a new sequence. The similarity of sequencesmay be determined based on some distance metric. For example, thesequence learner may determine the similarities of sequences using someminimum Hamming distance metric. The Hamming distance may be defined asthe number of single-entry changes needed to be made to one sequence toreach another sequence, including changes to “empty” slots either beforeor after the sequence (but not both). For example, if an old sequence is‘1234’, and the new sequence is ‘1235’, the Hamming distance is 1.

Further, in one or more embodiments of the present invention, a distancemetric may consider all possible shifts of one sequence relative to theother. For those element indices that overlap in a given shift, ‘0’ maybe counted if the elements match, and ‘1’ may be counted if the elementsdo not match. This number is added to the number of elements that do notalign with any element of the other sequence. For example, if an oldsequence is ‘1234’, and the new sequence is ‘345’, the result of thedistance metric may be determined as 2. Those skilled in the art willnote that various distance metrics may be created and/or used todetermine the similarity between two sequences.

Further, in one or more embodiments of the present invention, a sequencelearner may, for example, remove an old sequence based on the count(i.e., occurrence frequency) of the old sequence. More particularly, oldsequences with lower counts may be replaced before old sequences withhigher counts.

Further, in one or more embodiments of the present invention, a sequencelearner may limit how different old and new sequences can be before anold sequence is replaced. In other words, if an old sequence isrelatively very different than a new sequence, the sequence learner mayprevent that old sequence from being replaced by the new sequence. Suchcontrol may promote stable learning at higher levels.

If a sequence learner replaces an old sequence with a new sequence,then, in one or more embodiments of the present invention, countsassociated with subsequences of the old sequence may be removed from acorresponding table st_table.

In one or more embodiments of the present invention, as sequences areidentified and represented at an output of a sequence learner, thesequence learner may collect statistics on the represented sequences.For example, the sequence learner may identify the a priori probabilityof a particular sequence and/or the transition probability betweensequences.

At any time t, a sequence learner identifies the most likely sequencesto represent at its output as described above. As described above, thesequence learner is further arranged to compute the probability ofactually being in each of the represented sequences given the inputsreceived over time by the sequence learner.

By learning sequences as described above, a node in an HTM may coalesceboth space and time when learning causes. Thus, for example, while alower level child node learns causes based on patterns and sequencesthereof sensed over its input space, a higher level parent node is ableto learn higher level causes by coalescing both space and time over alarger input space. In other words, as information ascends through thehierarchy of an HTM, higher level nodes learn causes that cover largerareas of input space and longer periods of time than lower level nodes.For example, one or more nodes in a lowest level of an HTM may learncauses associated with a price of a particular stock, whereas one ormore nodes in a higher level of the HTM may learn causes associated withoverall stock market fluctuations.

In one or more embodiments of the present invention, computing theoutput probability over a learned sequence may be dependent on Γ(gamma). Γ may be denoted as a matrix indexed by two variables, S and I,where S corresponds to output sequences (e.g., S₁=‘y₄y₂y₃’, S₂=‘y₁y₂y₁’,S₃=‘y₃y₁’, S₄=‘y₂y₂y₁y₄’), and where I corresponds to the index withineach sequence (e.g., S₁[I]=y₄ when I=1). Γ(S, I) may be represented asshown in FIG. 7A.

At any point in time, each entry (S_(i), I_(m)) in a gamma matrixrepresents the probability that the current input vector corresponds tothe I_(m) ^(th) element of sequence S_(i). Each gamma may be determinedbased solely on the previous gamma and the input vector. Further, eventhough the result may depend on the input history of all past inputs,only the result from the previous time-step may need to be considered asthe result of the previous time-step implicitly contains all relevantinformation from all previous time-steps. Once gamma is determined, thetotal probability of sequence S_(i) may be determined as the sum acrossthe i^(th) row of the gamma matrix (normalized by the prior probabilityof the sequence).

In one or more embodiments of the present invention, an overall sequenceprobability in terms of gamma may be represented as follows:

${{P\text{(}e_{0}^{-}\mspace{11mu} \ldots \mspace{11mu} e_{t}^{-}\left. S_{i}^{t} \right)} = {\frac{1}{P\left( S_{i} \right)}{\sum\limits_{I_{m}}{\Gamma_{t}\left( {S_{i},I_{m}} \right)}}}},{where}$${{\Gamma_{t}\left( {S_{i},I_{m}} \right)} = {\sum\limits_{y_{t}}{P\text{(}e_{t}^{-}\left. y_{t} \right){\sum\limits_{y_{t - 1}}\left\lbrack {\sum\limits_{S_{j},{{I_{n}\text{:}y_{t - 1}} = {S_{j}{\lbrack I_{n}\rbrack}}}}{{\beta \left( {S_{i},S_{j},I_{m},I_{n}} \right)}{\Gamma_{t - 1}\left( {S_{j},I_{n}} \right)}}} \right\rbrack}}}},{{and}\mspace{14mu} {where}}$β(S_(i), S_(j), I_(m), I_(n)) = P(S_(i)^(t), I_(m)^(t), y_(t)S_(j)^(t − 1), I_(n)^(t − 1), y₀  …  y_(t − 1)).

Further, for example, in the case where a given sequence is observed inits entirety, the expression for β may be reduced to the following:

${\beta \left( {S_{i},S_{j},I_{m},I_{n}} \right)} = \left\{ {\begin{matrix}1 & {{{{if}\mspace{14mu} {S_{i}\left\lbrack I_{m} \right\rbrack}} = y_{t}},{{S_{j}\left\lbrack I_{n} \right\rbrack} = y_{t - 1}},{I_{m} = {I_{n} + 1}},{S_{i} = S_{j}}} \\A^{0} & {{{{if}\mspace{14mu} {S_{i}\left\lbrack I_{m} \right\rbrack}} = y_{t}},{{S_{j}\left\lbrack I_{n} \right\rbrack} = y_{t - 1}},{I_{m} = 1},{I_{n} = {{Len}\left( S_{j} \right)}}} \\0 & {otherwise}\end{matrix}.} \right.$

Those skilled in the art will note that the description above and belowin regard to computing (and initializing) gamma represents only anexample of how a sequence learner may calculate output probabilities.Now considering, for example, the four sequences given above (i.e., {S₁,S₂, S₃, S₄}, where S₁=‘y₄y₂y₃’, S₂=‘y₁y₂y₁’, S₃=‘y₃y₁’, S₄=‘y₂y₂y₁y₄’),the first two sums in the expression for gamma iterate through everypossible combination of previous and current elements. Consider one ofthose combinations, y^(t-1)=y₂ and y^(t)=y₁. In other words, theprevious input vector (though it contains a probability for everyelement y_(i)) represents a cause of y₂, and the current input vectorrepresents y₁. The expression for β (beta) may evaluate to a non-zerovalue for those entries in gamma that correspond to the elements y₂ andy₁ and time t−1 and t, respectively. These may be referred to as “activecells” in the gamma matrix as further shown in FIG. 7B.

Those skilled in the art will note that it may not be enough for a cellto be active at time t to satisfy non-zero conditions given in beta. Forthose cells that are not in the first column (I!=1), an active cell attime t may follow an active cell at time t−1 in the same sequence. Forthe example being used (namely, with respect to the four sequences {S₁,S₂, S₃, S₄} given above), there may be only one out of the four time-tactive cells for which this condition holds, the cell being circled (atthe head of the arrow) as shown in FIG. 7C. Because this is an internal(I!=1) case, the beta function may simply multiply the value stored inthe circled t−1 cell by one.

Further, those skilled in the art will note that beta may just be onefunction in the expression for beta given above. There may also be aneed to multiply the value in the circled t−1 cell (at the non-headed ofthe arrow) shown in FIG. 7C by P(e^(t)|y^(t)=y₁), which is equivalent tothe circled value in the input vector shown in FIG. 8.

Accordingly, the value added to the circled cell at time t is the valuein the circled cell from time t−1 multiplied by the value in the inputvector indicated shown in FIG. 8 (and multiplied by 1). This may be foronly one case of previous and current elements (y^(t-1)=y₂ andy^(t)=y₁). Iterations may be carried through every combination ofprevious and current elements, performing similar calculations, and theresults are cumulatively added to the gamma matrix at time t.

A further iteration may be considered—the iteration dealing with thecase relating to the first column (I=1). To visualize this, thoseskilled in the art may assume they are dealing with the case ofy^(t-1)=y₄ and y^(t)=y₁. The current element is the same, but now theremay be an assumption that the previous element was y₄ instead of y₂. Theactive cells are shown in FIG. 7D.

In such a case, there are no active cells at time t that follow anactive cell of the same sequence at time t−1. However, as shown in FIG.7E, there is a first-column (I=1) cell at time t and a final-elementcell at time t−1. Although this fails to satisfy the conditions forbeta=1, it does satisfy the conditions for beta=A⁰, where A⁰ representsthe (constant) transition probability between sequences (noting that thegeneral case may be represented as A⁰(S_(i),S_(j))). Those skilled inthe art will note that the circled t−1 cell (at the non-headed end ofarrow) shown in FIG. 7E need not be in the last column (I=4), but may bethe last element of a given sequence. Still referring to FIG. 7E, thevalue in the cell circled at time t−1 would be multiplied by A⁰ andmultiplied by the value corresponding to y₄ in the input vector, and theproduct would be added to the value stored in the circled cell at timet.

In summary, in one or more embodiments of the present invention, foreach combination of previous and current elements, a sequence learnermay determine which active cells satisfy the conditions for eitherbeta=1 or beta=A⁰. The sequence learner may multiply the legal valuesfrom time t−1 by the beta and then multiply by the corresponding valuefrom the input vector. The result across all combinations of previousand current elements is then summed to reach a final gamma.

As described above, in one or more embodiments of the present invention,each gamma is defined in terms of the previous gamma. With respect todetermining the first gamma, those skilled in the art will note that thefirst observed element, y^(t=0)=y_(a), may correspond to any index in asequence with equal likelihood. In one or more embodiments of thepresent invention, the number of occurrences of y₃ across all sequencesmay be determined as follows:

${T\left( y_{a} \right)} = {\sum\limits_{S_{i}}{\sum\limits_{I}{1{\left( {{S_{i}\lbrack I\rbrack} = y_{a}} \right).}}}}$

The probability of an element in a sequence is 1 over this sum if thatelement is a y₃ and zero otherwise:

${\Gamma_{0}\left( {S_{i},I} \right)} = {\sum\limits_{y_{i}:{{T{(y_{i})}} \neq 0}}{\frac{1}{T\left( y_{i} \right)}{P\left( {e_{t}^{-}{\left. y_{i} \right).}} \right.}}}$

For example, referring to FIG. 9, consider the first iteration of thesum, where y_(i)=y₁. There are 4 cells in the gamma matrix thatcorrespond to y₁. Each of these cells may be populated by ¼ multipliedby the first entry in the input vector, P(e_(t)|y₁). This operation maythen be repeated for y_(i)=y₂, and so forth.

Further, in one or more embodiments of the present invention, it may benecessary, or otherwise desirable, to initialize a gamma at times otherthan at time t=0. For example, in some cases, a sequence learner mayperform calculations that yield no useful results regarding the sequenceto which an input vector belongs. Thus, when a sequence learner has anoutput probability that meets one or more certain characteristics (e.g.,the output distribution is uniform), gamma may be re-initialized asdescribed above by treating the first input vector as a new input attime t=0.

Those skilled in the art will note that in one or more embodiments ofthe present invention, gamma will become small over time. Even whenhigh-probability elements correspond to legal paths along learnedsequences, there may be some energy in the input that does notcorrespond to legal paths and is therefore not passed along to theoutput probabilities. Further, each transition multiplies by a factor ofA⁰<1, which may diminish the input. However, the accuracy of thesequence learner may not be affected if, for example, the probabilitiesin a gamma matrix (examples described above) are normalized to 1. Thus,in one or more embodiments of the present invention, the outputdistribution of a sequence learner may simply be normalized to renderaccurate probabilities. Further, in one or more embodiments of thepresent invention, should it be desirable to prevent gamma fromdiminishing to numbers over time that are “too small,” gamma may beperiodically normalized. Gamma may be normalized, for example, bydividing each entry in the matrix by a sum total of the entire matrix.

Those skilled in the art will note that the description above in regardto computing (and initializing) gamma represents only an example of howa sequence learner may calculate output probabilities. In one or moreother embodiments of the present invention, a sequence learner may useone or more different operations or techniques to calculate outputprobabilities.

Further, in one or more embodiments of the present invention, a sequencelearner may output a probability for an input sequence as opposed to foreach input element. For example, if the sequence ‘123’ is received overtime, the sequence learner may output a probability upon receiving thelast element, i.e., ‘3’, in the sequence as opposed to outputting aprobability for each element ‘1’, ‘2’, and ‘3’. A determination as towhen a particular sequence ends and when to output the correspondingprobability may depend on one or more various criteria. For example, inone or more embodiments of the present invention, if a transitionprobability (e.g., A⁰ described above) meets a certain threshold, asequence learner may then output a probability for the sequence receivedover time until meeting the threshold. Further, in one or moreembodiments of the present invention, a sequence learner may output aprobability if a transition probability peaks (i.e., a fast risefollowed by a fast fall, or vice-versa). Further, in one or moreembodiments of the present invention, a sequence learner may output aprobability if a correlation between distributions indicates that a newsequence has occurred. Further, in one or more embodiments of thepresent invention, a sequence learner may track a change in a “motion”(i.e., computations) of the sequence learner and then output aprobability when there is a change inconsistent with the tracked motion.

Pooling

As described above, learning causes in an HTM-based system may involvelearning patterns and sequences of patterns. In general, patterns andsequences that occur frequently are stored and assigned to the samecauses. For example, groups of patterns that occur frequently at somestatistically significant rate may be assigned to the same cause. In thecase of sequences, sequences that occur frequently at some statisticallysignificant rate may be assigned to the same cause. Accordingly,learning causes may effectively entail mapping many patterns and/orsequences to a single cause. Such assigning of multiple patterns and/orsequences to a single cause may be referred to as “pooling.”

In one or more embodiments of the present invention, pooling may bedependent on “spatial” similarities between two or more patterns (notingthat a pattern may actually represent a sequence from a lower level). Insuch embodiments, an HTM node may compare a spatial property of areceived sensed input pattern with that of a learned sensed inputpattern (or “quantization” point). If the two patterns are “similarenough” (i.e., have enough “overlap”), then the received sensed inputpattern may be assigned to the same cause as that of the quantizationpoint. For example, if a quantization point is equal to ‘10010110’, thena received sensed input pattern of ‘10011110’ may be assigned to thesame cause as that of the quantization point due to there being adifference of only bit between the two patterns. Those skilled in theart will note that the amount of similarity needed to perform such“spatial” pooling may vary within and/or among HTM-based systems.

Further, in one or more embodiments of the present invention, poolingmay involve assigning patterns that occur in order to the same cause.For example, if an HTM node receives pattern A followed by pattern Bfollowed by pattern D, then patterns A, B, and D may be assigned to thesame cause as there is some likelihood that this sequence of patternswas caused by the same object. Accordingly, such “temporal” poolingenables the mapping of patterns, some or all of which may have nosignificant spatial overlap, to a single cause.

Further, in one or more embodiments of the present invention, poolingmay involve learning the timing between received input patterns. Forexample, an HTM node that learns a sequence of patterns A, B, and C mayalso learn the timing between the patterns in the sequence. Sequenceshaving such timing are assigned to the same cause. In such a manner, anHTM node, and an HTM in general, may assign sequences to a cause basedon rhythm (i.e., the timing relationship from one element in a sequenceto the next element in the sequence) and/or tempo (i.e., the overallspeed of the sequence).

Further, in one or more embodiments of the present invention, poolingmay involve controlling an HTM node to assign two or more patterns tothe same cause. For example, a higher level HTM node may send a signalto a lower level HTM node directing the lower level HTM node to assigntwo or more patterns received by the lower level HTM node to the samecause. These two or more patterns may have no spatial overlap ortemporal relationship.

Determining Causes of Novel Input

After an HTM has learned, or while the HTM is continuing to learn, oneor more causes in its world, the HTM may determine causes of novel inputusing what may be referred to as “inference.” In general, presented withnovel sensed input data, an HTM may infer which of its learned causesis/are the source of the novel sensed input data based on statisticalcomparisons of learned patterns and sequences thereof with patterns andsequences thereof in the novel sensed input data.

When an HTM node receives a new sensed input pattern, the HTM nodeassigns probabilities as to the likelihood that the new sensed inputpattern matches each of its learned sensed input patterns. The HTM nodethen combines this probability distribution (may be normalized) withprevious state information to assign probabilities as to the likelihoodthat the new sensed input pattern is part of each of the learnedsequences of the HTM node. Then, as described above, the distributionover the set of sequences learned by the HTM node is passed to a higherlevel node.

Those skilled in the art will note that the distribution passed by anHTM node is derived from a “belief” as to the likelihood that eachlearned cause is the cause of sensed input patterns at the input of theHTM node. A “belief” also includes those messages that are derived fromor based on the belief. For example, an HTM node having learned fivecauses may deterministically assign percentages to each of the fivelearned causes as being the cause of sensed input patterns. Thedistribution of percentages (or “belief” as described above) may benormalized (or unnormalized) and passed to a parent node. The parentnode may then determine coincidences among the distributions sent fromits child nodes, and then, based on its learned sensed input patternsand sequences thereof, pass to a yet higher level node its own belief asto the likelihood that each of its learned causes is the cause of sensedinput patterns at its input. In other words, a parent node forms its own“higher level” belief as to the cause of the sensed input patterns atleast partly based on some statistical convergence of the beliefs passedfrom its child nodes.

Further, in one or more embodiments of the present invention, inferringcauses may occur during learning. Further, in one or more embodiments ofthe present invention, learning by an HTM may be disabled, in whichcase, inference may continue to occur.

As described above, one or more causes of sensed input patterns may bedetermined by an HTM through a series of inference steps ascendingthrough the hierarchy of the HTM. Further, in one or more embodiments ofthe present invention, one or more causes of sensed input patterns maybe determined based on information descending through the hierarchy ofthe HTM. In general, by combining its memory of likely sequences ofsensed input patterns with current input (i.e., beliefs from lower levelnodes), a node in an HTM may have the ability to “predict” (i.e., make“predictions” as to) what is likely to happen next.

When a node in an HTM generates a prediction of what is likely to happennext, the prediction, or “prior probability,” biases lower level nodesin the HTM to infer the predicted causes. This may be achieved by ahigher level node passing a probability distribution over its learnedsensed input patterns (as opposed to over its learned sequences) to alower level node. This probability distribution may be used by the lowerlevel node as an expectation as to the next sensed input pattern. Forexample, if an HTM is processing text or spoken language, the HTM mayautomatically predict what sounds, words, and ideas are likely to occurnext. Such a process may help the HTM understand noisy or missing data.In other words, for example, if an ambiguous sound arrived, the HTM maylikely interpret the sound based on what the HTM was expecting. Ingeneral, prediction may influence the inference process by biasing atleast part of an HTM to settle on one or more expected beliefs.Moreover, in one or more embodiments of the present invention, aprediction may be fed back from a higher level node in an HTM to a lowerlevel node in the HTM as a substitute (at least in part) for sensoryinput data to the lower level node.

Further, in one or more embodiments of the present invention, one ormore prior probabilities may be set manually in addition to or insteadof having prior probabilities set via prediction. In other words, an HTMmay be manually controlled to anticipate a particular cause or set ofcauses.

Belief Propagation

As described above, in one or more embodiments of the present invention,inferring causes of sensed input patterns involves passing beliefs fromlower level nodes to higher level nodes. In FIG. 10, such “beliefpropagation” is shown in HTM 80 (beliefs indicated with arrows; nodesshown, but not labeled). Generally, as described above, a belief is avector of values, where each value represents a different cause. Acurrent belief of a node may be a distribution of several causes beingat least partially active at the same time. Further, the values in thebelief vector may be normalized so that a stronger likelihood of onecause represented in the vector will diminish the likelihood of othercauses represented in the vector. Further, those skilled in the art willnote that a meaning of a value representing a cause in a belief vectormay not vary depending on what other causes represented in the beliefvector are active.

As described above with reference to FIG. 2, an HTM is a hierarchy ofconnected nodes. Each node may be thought as having a belief. In one ormore embodiments of the present invention, a belief at one node mayinfluence a belief at another node dependent on, for example, whetherthe nodes are connected via a conditional probability table (CPT).

A CPT is a matrix of numbers, where each column of the matrixcorresponds to the individual beliefs from one node, and where each rowof the matrix corresponds to the individual beliefs from another node.Thus, those skilled in the art will note that by multiplying a vectorrepresenting a belief in a source node by an appropriate CPT results ina vector in the dimension and “language” of beliefs of a destinationnode. For example, in an HTM-based system designed for operation in a“weather” domain, a lower level node may form a belief about airtemperature and have values representing the likelihood of the followingcauses: “hot”; “warm”; “mild”; “cold”; and “freezing”. A higher levelnode may form a belief about precipitation and have values representingthe likelihood of the following causes: “sunny”; “rain”; “sleet”; and“snow”. Thus, using a CPT, the belief about air temperature in the lowerlevel node may inform the belief about precipitation in the higher levelnode (and vice-versa). In other words, multiplying the vectorrepresenting the belief about air temperature in the lower level node bythe CPT results in a vector representing the appropriate belief aboutprecipitation in the higher level node.

Accordingly, in one or more embodiments of the present invention, beliefpropagation allows an HTM to infer causes such that each node in the HTMrepresents a belief that is maximally or optimally consistent with itsinput. Those skilled in the art will note that performing inference insuch a manner results in ambiguities being resolved as beliefs ascendthrough the HTM. For example, in an HTM (or part thereof) having aparent node and two child nodes, if (i) the first child node believeswith 80% certainty that it is seeing a “dog” and with 20% certainty thatit is seeing a “cat” and (ii) the second child node believes with 80%certainty that it is hearing a “pig” and with 20% certainty that it ishearing a “cat,” then the parent node may decide with relatively highcertainty that a “cat” is present and not a “dog” or “pig.” The parentnode effectively settled on “cat” because this belief is the only onethat is consistent with its inputs, despite the fact the “cat” image andthe “cat” sound were not the most likely beliefs of its child nodes.

Further, as described above, a higher level node in an HTM may pass a“prediction” to a lower level node in the HTM. The “prediction” is a“belief” in that it contains values representing the likelihoods ofdifferent causes. The vector representing the belief in the higher levelnode may be multiplied by an appropriate CPT to inform a belief in thelower level node. Thus, in effect, a higher level node in an HTM usesits learned sequences combined with recent state information (i.e., thecurrent input to the higher level node) to (i) predict what its nextbelief should be and (ii) then pass the expectation down to one or morelower level nodes in the HTM.

FIG. 11 shows a flow process in accordance with an embodiment of thepresent invention. Particularly, FIG. 11 shows in summary the steps ofbelief propagation described above. Initially, a current node in the HTMreceives input (in the form of sensed input patterns or beliefs fromlower level nodes) ST82. Based on the received input and any beliefspassed down from a higher level node, the current node forms/adjusts itsbelief as to the likelihood of causes at its input distributed over itslearned causes ST84. This belief is then passed to higher level and/orlower level nodes to inform beliefs at those nodes ST86.

Spatial Attention

To facilitate a determination of causes of input patterns sensed by anHTM, the HTM may “focus” the determination. An HTM provided with theability to focus when determining causes of sensed input patterns may bereferred to as having “attention.” For example, in one or moreembodiments of the present invention, an HTM may have the capacity tofocus on a subset of an entire input space. An HTM having such acapacity may be referred to as having “spatial attention.”

FIG. 12 shows a portion of an HTM 90 having spatial attention inaccordance with an embodiment of the present invention. The portion ofHTM 90 shown in FIG. 12 has level L1 nodes 92, 94 and level L2 node 96.Level L1 node 92 has an input range of i₁-i_(x), and level L1 node 94has an input range of i_(x+1)-i_(y). Accordingly, level L2 node 96 hasan input range of i₁-i_(y).

As shown in FIG. 12, level L1 nodes 92, 94 are connected to level L2node 96 by connections 98, 100. Connections 98, 100 are referred to asbeing “permanent” in that data/information is always allowed to flowfrom level L1 nodes 92, 94 to level L2 node 96 over connections 98, 100.

Further, level L1 nodes 92, 94 may be connected to level L2 node 96 byconnections 102, 104. Connections 102, 104 are routed through a relaymodule 106. Those skilled in the art will note that the depiction ofrelay module 106 in FIG. 12 is only a representation. In other words,although relay module 106 is shown in FIG. 12 as being positionedbetween level L1 nodes 92, 94 and level L2 node 96, in one or more otherembodiments of the present invention, relay module 106 may be positionedelsewhere (either in software or hardware).

In the case, for example, that level L2 node 96 is “not payingattention” to level L1 node 92 due to the state of relay module 106, iflevel L1 node 92 experiences an unexpected event at its input, level L1node 92 may send a “strong” signal to relay module 96 over connection108 in order to cause relay module 106 to allow data/information to flowfrom level L1 node 92 to level L2 node 96 over connection 102. Further,in the case, for example, that level L2 node 96 is “not payingattention” to level L1 node 94 due to the state of relay module 106, iflevel L1 node 94 experiences an unexpected event at its input, level L1node 94 may send a “strong” signal to relay module 106 over connection100 in order to cause relay module 106 to allow data/information to flowfrom level L1 node 94 to level L2 node 96 over connection 104.

Further, in the case, for example, that level L2 node 96 is “not payingattention” to level L1 node 92 due to the state of relay module 106, iflevel L2 node 96 needs to pay attention to the input space of level L1node 92, level L2 node 96 may send a “strong” signal to relay module 106over connection 112 in order to cause relay module 106 to allowdata/information to flow from level L1 node 92 to level L2 node 96 overconnection 102. Further, in the case, for example, that level L2 node 96is “not paying attention” to level L1 node 94 due to the state of relaymodule 106, if level L2 node 96 needs to pay attention to the inputspace of level L1 node 94, level L2 node 96 may send a “strong” signalto relay module 106 over connection 114 in order to cause relay module106 to allow data/information to flow from level L1 node 94 to level L2node 96 over connection 104.

Further, the flow of data/information over connections 102, 104 may bedependent on the assertion of signals to relay module 106 overconnections 116, 118. As shown in FIG. 12, connections 116, 118 do notoriginate from level L1 nodes 92, 94 or level L2 node 96. Instead, forexample, in one or more embodiments of the present invention, signalsover connections 116, 118 may be controlled by a control module (notshown). Generally, in one or more embodiments of the present invention,signals over connections 116, 118 may originate from any portion of anHTM-based system not shown in FIG. 12.

As described above, relay module 106 provides a means to switch “on” and“off” connections between lower and higher level nodes. This has theeffect of limiting or increasing what an HTM perceives.

Further, in one or more embodiments of the present invention, relaymodule 106, instead of switching “on” and “off” data/information flowover connections 102, 104, may otherwise modify or set the value ofdata/information flowing over connections 102, 104. For example, relaymodule 106 may modify a probability distribution sent from level L1 node92 over connection 102.

Category Attention

In one or more embodiments of the present invention, an HTM, possibly inaddition to having spatial attention, may have what may be referred toas “category attention.” An HTM having category attention may focus theHTM on a particular category of causes/objects. FIG. 13 shows a portionof an HTM 120 in accordance with an embodiment of the present invention.In FIG. 13, the levels and nodes (shown, but not labeled) are similar tothat shown and described above with reference to FIG. 2. Further, HTM120 is provided with, or at least connected to, a category attentionmodule 122. The category attention module 122 may be singly or multiplyconnected (possible connections indicated in FIG. 13 with dashed lines)to any of the nodes in HTM 120.

Category attention module 122 allows for the control of categories ofcauses (e.g., by selecting one or more contexts) that may be consideredby a node connected to the category attention module 122. Thus, forexample, if HTM 120 expects to receive inputs of category “CAT,”category attention module 122 may assert a signal to the only node inlevel L3 so as to effectively switch “off” the consideration ofnon-“CAT” categories (e.g., category “DOG”). In other words, categoryattention module 122 may be used to select a context for what at least aportion of HTM 120 perceives. In one or more other embodiments of thepresent invention, category attention module 122 may assert a contextthat is not to be perceived by at least a portion of HTM 120. Forexample, category attention module 122 may assert context “DOG,” wherebyall contexts other than “DOG” may be perceived by HTM 120.

Directed Behavior

As described above, an HTM in accordance with embodiments of the presentinvention is able to learn and form representations of causes in itsworld and then later predict causes as the HTM senses novel input. Inessence, an HTM that has learned how causes in its world behave overtime has created a model of its world. In one or more embodiments of thepresent invention, the ability of an HTM to predict causes over time maybe used to direct behavior as described below with reference to FIGS. 14and 15.

FIG. 14 shows a portion of an HTM-based system 130 in accordance with anembodiment of the present invention. The HTM-based system 130 has an HTM146 formed of levels L1, L2, L3, where level L1 has nodes 132, 134, 136,138, level L2 has nodes 140, 142, and level L3 has node 144. The HTM 146receives sensed input data, learns and forms representations of causesof the sensed input data, and then infers and predicts causes of novelsensed input data based on its learned causes and representationsthereof.

The HTM-based system 130 further includes a motor behavior and controlmodule 148. The motor behavior and control module 148 has “built-in” orpreprogrammed behaviors, which are essentially primitive behaviors thatexist independent of the HTM 146. As the HTM 146 discovers and learnscauses in its world, the HTM 146 learns to represent the built-inbehaviors just as the HTM 146 learns to represent the behavior ofobjects in its world outside of the HTM-based system 130. Those skilledin the art will note that from the perspective of the HTM 146, thebuilt-in behaviors of the HTM-based system 130 are simply causes in itsworld. The HTM 146 discovers these causes, forms representations ofthem, and learns to predict their activity.

Those skilled in the art will note that in one or more embodiments ofthe present invention, the motor behavior and control module 148 may bepart of or associated with a robot. However, in one or more otherembodiments of the present invention, the motor behavior and controlmodule 148 may not be part of or associated with a robot. Instead, forexample, the motor behavior and control module 148 may simply providesome mechanism for movement of the HTM-based system 130.

As described above, HTM 146 learns and forms representations of thebuilt-in behaviors of the HTM-based system 130 as carried out by themotor behavior and control module 148. Next, through an associativememory mechanism, the representations of the built-in behaviors learnedby the HTM 146 may be paired with the corresponding mechanisms in themotor behavior and control module 148. For example, in one or moreembodiments of the present invention, a node in HTM 146 having a learnedrepresentation of a particular built-in behavior (or a part thereofdepending on a position of the node in the HTM 146) may send one or moresignals to the motor behavior and control module 148 to determine whichmechanisms in the motor behavior and control module 58 are active duringthe occurrence of the particular built-in behavior. Thus,representations of built-in behavior carried out by the HTM-based system130 are learned by the HTM 146 and then may be associated with thecorresponding mechanisms in the motor behavior and control module 148.

Those skilled in the art will note that in one or more embodiments ofthe present invention, the learned representations of the built-inbehaviors in the HTM 146 may be associated or correlated with themechanisms creating the built-in behaviors in the motor behavior andcontrol module 148 based on an implementation representing some form ofHebbian learning.

After the association of a learned behavioral representation in the HTM146 with a corresponding behavioral mechanism in the motor behavior andcontrol module 148, when the HTM 146 next predicts that behavior, it mayactually cause the behavior to occur. For example, using an analogue tohuman behavior, breathing is considered a built-in, or innate, behavior.A newborn human breathes without having to first learn how to breathe(similar to, for example, eye blinking and movement away from pain).Over time, the human associates learned representations of breathingwith the actual muscles that cause breathing. Based on this determinedassociation, the human may then control his/her breathing by, forexample, purposefully deciding when to breathe in and/or breathe out. Ina similar manner, returning to the context of the HTM-based system 130,the HTM 146, once having learned a representation of a particularbehavior (e.g., movement of a robot limb) caused by the HTM-based system130 and associating the learned representation with a correspondingbehavioral mechanism (e.g., the motor responsible for causing movementof the robot limb), may cause, via prediction, the particular behaviorto occur.

FIG. 15 shows a flow process in accordance with an embodiment of thepresent invention. In ST150, an HTM-based system generates some sort ofbehavior. The HTM in the HTM-based system observes the behavior ST152,and subsequently over time, the HTM learns causes and formsrepresentations of the observed behavior ST154. Nodes in lower levels ofthe HTM learn causes and form representations of smaller parts of thebehavior relative to that learned and formed by nodes in higher levelsof the HTM. For example, in the context of a robot capable of walking ina human-like way, lower level nodes in the HTM may learn causes and formrepresentations of particular toe or knee movements, whereas largerlevel nodes in the HTM may learn causes and form representations ofentire leg, hip, and torso movements.

Once the HTM learns causes and forms representations of the observedbehavior in ST154, each of the nodes in the HTM associates learnedcauses with corresponding behavioral mechanisms in the HTM-based systemST156. For example, in the context of the robot capable of walking in ahuman-like way, lower level nodes in the HTM may associaterepresentations of particular toe and knee movements with the mechanismsin the HTM-based system that cause these movements, whereas higher levelnodes in the HTM may associate representations of entire leg, hip, andtorso movements with the mechanisms in the HTM-based system that causethese larger, or higher-level, movements.

After determining associations between learned behavioralrepresentations and their corresponding behavioral mechanisms in ST156,the HTM, based on information propagated to and/or through the HTM, maypredict and cause particular behaviors to occur ST158. Those skilled inthe art will note that in such a manner, an HTM may string togethercomplex sequences of learned built-in behaviors to create novel,complex, and/or goal-oriented behavior.

Further, in one or more embodiments of the present invention, anHTM-based system may be controlled so as to switch “off” the ability ofan HTM to cause one or more particular behaviors. This may be achievedby use of a control module that is capable of selectively switching“off” or damping particular signals from nodes in the HTM to a motorbehavior and control component of the HTM-based system.

Architecture

In one or more embodiments of the present invention, at least part of anHTM network may be provided as a software platform. The HTM network mayrun on various computer architectures. For example, as shown in FIG. 16,an HTM network (nodes shown, but not labeled) 160 may run on a singlecentral processing unit (CPU) 162.

Further, as shown in FIG. 17, in one or more embodiments of the presentinvention, an HTM network (nodes shown, but not labeled) 164 may runacross several CPUs 166, 168, 170. The CPUs 166, 168, 170 may either bepart of a single system (e.g., a single server) or multiple systems. Forexample, an HTM network may be created in software across severalmultiprocessor servers, where such a group of servers may be referred toas a “cluster.” The servers in a cluster may be heterogeneous, i.e., theservers may have differing configurations/specifications (e.g., clockspeeds, memory size, number of processors per server). Further, theservers may be connected via Ethernet or one or more other networkingprotocols such as, for example, Infiniband, Myrinet, or over a memorybus. Further, the servers may run any operating system (OS) (e.g.,Windows, Linux). In general, each of the servers in a cluster may beresponsible for running some portion of an HTM network. The portion ofthe HTM network dedicated to each server may vary from server to serverdepending on, for example, the configuration/specification of eachserver.

Further, in one or more embodiments of the present invention, the CPUsover which an HTM network runs may be located at a single location(e.g., at a datacenter) or at locations remote from one another.

As described above, in one or more embodiments of the present invention,at least part of an HTM network may be provided as a software platform.The software executables for creating and running the HTM network may bereferred to as being part of a “runtime engine.” As shown in FIG. 18, aruntime engine 172 of an HTM-based system includes, in addition to theexecutables for running an HTM network 174, a Supervisor entity 176. Inone or more embodiments of the present invention, the Supervisor entity176 is responsible for, among other things, starting and stopping theHTM network 174 and communicating with external applications (i.e.,“tools”) 180, 182, 184, each of which are further described below.However, although the Supervisor entity 176 may be used to start andstop the HTM network 174, it may not be necessary for the Supervisorentity 176 to be running while the HTM network 174 is in operation.

As shown in FIG. 18, the Supervisor entity 176 is associated with a netlist 178. The Supervisor entity 176 uses a description in the net list178 to configure the HTM network 174. For example, a description in thenet list 178 may specify the distribution of nodes across a given set ofCPUs. However, in one or more other embodiments of the presentinvention, the Supervisor entity 176 may configure an HTM networkdynamically if, for example, certain information is not contained in thenet list 178. Further, in one or more embodiments of the presentinvention, the Supervisor entity 176 may read a net list from a datefile. Further, in one or more embodiments of the present invention, anet list may be specified interactively by a user using one or moretools 180, 182, 184.

Further, in one or more embodiments of the present invention, theSupervisor entity 176 may perform global network actions, distributenodes across CPUs, and/or coordinate CPU activity/behavior. Further, inone or more embodiments of the present invention, the Supervisor entity176 may enforce licensing restrictions such as those relating to, forexample, the number of usable CPUs, license expiration dates, number ofuser limitations, and/or the ability to load third-party “plug-ins.”

Further, in one or more embodiments of the present invention, theSupervisor entity 176 may check for software updates on some regularbasis. In such embodiments, if there is a software update available, theSupervisor entity 176 may, for example, install the software update andrestart the HTM network 174. Further, in one or more embodiments of thepresent invention, the Supervisor entity 176 may determine and/or selectthe order in which portions of the HTM network 174 are to be updated.

Further, in one or more embodiments of the present invention, theSupervisor entity 176 may communicate with one or more CPUs (not shownin FIG. 18) running the HTM network 174 using, for example, a private orinternal application program interface (API). Further, in one or moreembodiments of the present invention, the Supervisor entity 176 and theone or more CPUs (not shown in FIG. 18) running the HTM network 174 mayall be on the same local area network (LAN).

Further, in one or more embodiments of the present invention, theSupervisor entity 176 may run on a CPU separate from one or more CPUs(not shown in FIG. 18) running the HTM network 174. However, in one ormore other embodiments of the present invention, the Supervisor entity176 may run on a CPU that runs all or part of the HTM network 174.

FIG. 19 shows at least a portion of an HTM-based system that runs an HTMnetwork 186 on a single CPU 188. In such embodiments of the presentinvention, an instance of Supervisor entity 190, along with a net list192, may run on CPU 188. Further, as shown in FIG. 19, a runtime engine194 may be composed of the software executables for the HTM network 186,the Supervisor entity 190, and the net list 192.

FIG. 20 shows at least a portion of an HTM-based system that runs an HTMnetwork 220 on multiple CPUs 222, 224, 226. The CPUs 222, 224, 226 mayall be part of the same server (thereby, sharing resources of thatserver) or they may be distributed over two or more servers. An instanceof Supervisor entity 228, along with a net list 230, may run on aseparate CPU 232. In such embodiments of the present invention, theSupervisor entity 228 may communicate (across, for example, a switch234) with instances of “node processing units” (NPUs) 236, 238, 240running on each of the CPUs 222, 224, 226. Each NPU 236, 238, 240 may bea software component that is responsible for running and/or scheduling aportion (i.e., a “sub-net”) of the HTM network 220 running on the CPU222, 224, 226 to which the NPU 236, 238, 240 is respectively allocated.At an initial stage, each NPU 236, 238, 240 may receive information fromthe Supervisor entity 228 describing all or part of the HTM network 220,including information relating to the portion of the HTM network 220that each NPU 236, 238, 240 will manage. Further, each NPU 236, 238, 240may be responsible for allocating the memory needed for the nodes,links, and other data structures for the portion of the HTM network 220for which it is responsible. Further, each NPU 236, 238, 240 may runand/or schedule a portion of the HTM network 220 in some timing relationto at least one other NPU 236, 238, 240.

Further, in one or more embodiments of the present invention, each NPU236, 238, 240 may maintain a local net list. A local net list may beused by an NPU to determine when to update one or more nodes, where“updating” a node may include executing an operation of the node andthen updating the state of the node. An NPU may perform such updatingbased on, for example, one or more timestamps of previous updates of oneor more nodes, one or more values (e.g., beliefs) of one or more nodes,priorities of one or more nodes, and/or a set of rules for updatingnodes.

Further, as shown in FIG. 20, a runtime engine 242 may be composed ofthe software executables for the HTM network 220, the Supervisor entity228, the net list 230, and the NPUs 236, 238, 240. Moreover, a fileserver (not shown) may be present to store file information for one ormore of the various components shown in FIG. 20.

Further, as shown, for example, in FIG. 20, there is one NPU per CPUrunning a portion of an HTM network. However, in one or more otherembodiments of the present invention, there may be a differentrelationship as to the number of NPUs allocated per CPU.

As described above with reference to FIG. 18 (also shown in FIGS. 19 and20), a runtime engine 1720 running HTM network 174 may interface withone or more tools 180, 182, 184. Each of these tools 180, 182, 184 maybe used by a user (e.g., a software developer) to, for example, modify,improve, augment, restrict, configure, or otherwise affect an operationor configuration of the HTM network 174 or a CPU on which the HTMnetwork 174 runs. Generally, in one or more embodiments of the presentinvention, Configurator tool 180 may be used to create and/or configurean HTM network, Trainer tool 182 may be used to create a trained HTMnetwork for a particular application, and/or Debugger tool 184 may beused to debug the operation of an HTM network. Further, in one or moreembodiments of the present invention, tools (not shown) may be providedto, for example, monitor/report performance of an HTM network and/ordeploy a designed, trained, and/or debugged HTM network as a runningapplication. In general, one or more embodiments of the presentinvention may use any number and/or types of different tools tointerface with an HTM network.

In one or more embodiments of the present invention, a Supervisor entity(e.g., 176 in FIG. 18, 190 in FIG. 19, 228 in FIG. 20) may communicatewith developer/client tools (e.g., 180, 182, 184 in FIG. 18) using adesignated Supervisor API. In one or more embodiments of the presentinvention, the Supervisor API may support Unicode and/or multi-bytecharacter sets.

Because the developer/client tools may reside at, or otherwise beaccessible from, locations remote from a location running a particularHTM network, a Supervisor API may be accessible through, for example, afirewall. One protocol that may be used to facilitate such accessibilityinvolves encoding messages in Extensible Markup Language (XML) andpassing them over the Internet (i.e., HTTP transmission). If security isdesired or required, then messages may be passed over a secure Internetprotocol (e.g., HTTPS transmission). Further, in one or more embodimentsof the present invention, if a Supervisor entity (e.g., 176 in FIG. 18,190 in FIG. 19, 228 in FIG. 20) and developer/client tools (e.g., 180,182, 184 in FIG. 18) are on the same LAN, messages may be passed usingmeans such as, for example, socket connections and/or pipes.

As described above, a Supervisor API may interact with developer/clienttools. In one or more embodiments of the present invention, theSupervisor API may be used to authenticate one or more clientapplications attempting to communicate with a Supervisor entity (e.g.,176 in FIG. 18, 190 in FIG. 19, 228 in FIG. 20). If the client isauthenticated, the Supervisor API may return session information to theclient and connect the client with the Supervisor entity. The SupervisorAPI may also disconnect the client from the Supervisor entity.

Further, in one or more embodiments of the present invention, a net listdescribing all or part of an HTM network may be passed from a client toa Supervisor entity through a Supervisor API. Further, a Supervisor APImay be used to return state information to the client. State informationmay include, for example, the beliefs at one or more nodes of the HTMnetwork, whether the HTM network is running, paused, or restarting, thenumber of nodes in all or part of the HTM network, and the number ofCPUs actively running portions of the HTM network. Further, a SupervisorAPI may be accessed to start, pause and restart, or stop an HTM network.

Further, in one or more embodiments of the present invention, aSupervisor API may be accessed to: return a list of network files thathave been stored by a system (e.g., a cluster of servers) used to run anHTM network; load an HTM network from a network file stored locally in asystem (e.g., a cluster of servers) usable to run an HTM network;locally save a state of an HTM network in a system (e.g., a cluster ofservers) running the HTM network; move one or more nodes from running onone CPU to running on another CPU; turn a debugging feature “on” or“off”; retrieve detailed state information of a component in an HTMnetwork; set a state of a component in an HTM network; instruct an HTMnetwork to pause operations after a specific triggering event, where thetriggering event may be completion of one complete iteration of the HTMnetwork, completion of updating a given list of nodes, completion ofupdating one node on each CPU, reaching a particular time, reaching aparticular node value, and/or an occurrence of an error; retrievestatistics regarding operation of an HTM network; request storage ofhistorical data regarding an HTM network; retrieve stored historicaldata regarding an HTM network; retrieve messages from an event log that,for example, occurred during a particular time frame; execute an OScommand; reboot a set of servers used to run an HTM network; and/orrequest the triggering of an alarm if certain conditions are met.

Further, in one or more embodiments of the present invention, aSupervisory API may have a “batch command” system. In one or moreembodiments of the present invention, a batch command system may be usedto execute one or more operations of a Supervisor API in a particularsequence. Further, in one or more embodiments of the present invention,a batch command system may be used to execute one or more of the samecommands on more than one node. Further, in one or more embodiments ofthe present invention, a batch command system may include thecapabilities of a full scripting language (e.g., Python, Perl) so that,for example, ‘if’ statements and loops may be performed easily. Thoseskilled in the art will note that the use of a full scripting languagemay allow a user to script complex commands (e.g., commands: train level1 of hierarchy until states of level 1 nodes reach a given condition;then turn “off” learning in level 1 and train level 2 of hierarchy untilstates of level 2 nodes reach a given condition, etc.).

Further, in one or more embodiments of the present invention, theSupervisor API may be arranged to handle a failure of any of thehardware components needed to run a particular HTM network. Further, inone or more embodiments of the present invention, the Supervisor API mayhandle a software failure (e.g., failure of an NPU instance). Further,in one or more embodiments of the present invention, the Supervisor APImay handle a communication establishment error. Further, in one or moreembodiments of the present invention, the Supervisor API may handle oneor more errors in reading a provided net list describing a particularHTM network.

In addition to the Supervisor API, an HTM-based system may also have aNode Plug-in API 250 as shown in FIG. 21. In FIG. 21 (elements labeledsimilarly to that shown in FIG. 19), the Node Plug-in API 250 may beused to create new node types. For example, the Node Plug-in API 250 maybe used to interface new hardware for running the HTM network 186 and/orimplement, for example, new learning algorithms. In one or moreembodiments of the present invention, using the Node Plug-in API 250,one or more “plug-ins” may be dynamically loaded when the HTM network186 is initialized or rebooted. In such a manner, a functionality of aruntime engine running the HTM network 186 may be extended as furtherdescribed below.

Extensibility

As described above, in one or more embodiments of the present invention,an HTM network may be provided as a software platform. To enable the HTMnetwork to be usable in various different domains and/or modifiable byvarious entities (e.g., software developers, client or user-levelapplications), the functionality of all or part of the HTM may be“extensible.” Those skilled in the art will note that the term“extensible” in the context of software describes a software entity(e.g., a computer program, a programming language, a routine) that canhave its capabilities “extended” (e.g., changed, augmented).

In one or more embodiments of the present invention, extensibility maybe afforded to an HTM network by having abstract interfaces for one ormore of the components of the HTM network. For example, in one or moreembodiments of the present invention, an abstract interface for acomponent of an HTM network may be implemented using a base class ifusing object-oriented programming (e.g., C++, Java® (developed by SunMicrosystems, Inc. of Santa Clara, Calif.)) to implement the HTMnetwork. Those skilled in the art will note that a base class inobject-oriented programming is a class from which other classes (e.g.,subclasses, child classes, derived classes) inherit members. Further,those skilled in the art will note that a base class may also bereferred to as a “superclass” or “parent” class.

FIG. 22 shows an inheritance diagram of an HTM network 260 in accordancewith an embodiment of the present invention. In general, the HTM network260 is formed of one or more “entities,” where each entity defines aninterface that is implemented through instantiation in order to renderthat entity extensible. In one or more embodiments of the presentinvention, the collection of entities in the HTM network 260 may bespecified by a net list that is part of a software file that defines andis used to implement the HTM network 260. Once instantiated, theentities specified in the net list may communicate in some synchronizedfashion and collaborate to perform some collective computation of theHTM network 260.

The HTM network 260 shown in FIG. 22 has a Base entity 274 that linksthe following named entities, each of which is further described below:Sensor 262; Effector 264; Link 266; Supervisor 268; Router 270; andLearning and Inference/Prediction Algorithm 272 (shown in FIG. 3 as“Learning”). Each of the entities 262, 264, 266, 268, 270, 272, 274 isan abstract interface implemented using a base class as described above.

As shown in FIG. 22, each entity 262, 264, 266, 268, 270, 272, 274 hasID, priority, and type attributes. The ID attribute identifies eachentity. This attribute may not only identify an entity, but may also beused to indicate a specific CPU, set of CPUs, or machine on which to runthe entity. The priority attribute denotes a priority, in terms ofprocessing order, of an entity. The type attribute indicates a type ofthe entity. Further, as shown in FIG. 22, each entity 262, 264, 266,268, 270, 272, 274 has a compute( ) method, which is invocable (by, forexample, a subclass of the base class entity) to perform somecomputation.

Further, although FIG. 22 shows a particular number and types ofentities, in one or more other embodiments of the present invention, anHTM network may have a different number and/or one or more types ofentities different than that shown in FIG. 22. For example, in one ormore embodiments of the present invention, an HTM network may not havean Effector entity.

In one or more embodiments of the present invention, softwareexecutables for running an HTM network may run at the level of Baseentity 274. In other words, Base entity 274 may be thought of as workingat the level of a net list containing the description of the HTMnetwork. In such a manner, a user-level application for creating,running, designing, debugging, training, modifying, and/or otherwiseusing an HTM network may simply interface with Base entity 274 withouthaving to “know” about, for example, one or more of the other entities262, 264, 266, 268, 270, 272 shown in FIG. 22.

In one or more embodiments of the present invention, Sensor entity 262specializes in handling inputs sensed by the HTM network 260, wherecauses of the inputs exist in the domain in which the HTM network 260 isimplemented. Those skilled in the art will note that there may anynumber of Sensor entities 262 in a net list defining the HTM network260. The exact behavior of Sensor entity 262 (implemented as a baseclass) is extensible through the modification or addition of one or moresubclasses. For example, as shown in FIG. 22, Sensor entity 262 has thefollowing subclasses: a gray-scale sensor subclass 276; a color imagesensor subclass 278; a binary image sensor subclass 280; and an audiosensor subclass 282. Each of these subclasses 276, 278, 280, 282contains functionality specific to the type of each subclass 276, 278,280, 282. In other words, Sensor entity 262 may have no “knowledge” ofthe specific functionalities performed by each of its subclasses 276,278, 280, 282. Further, although FIG. 22 shows a particular number andtypes of subclasses, in one or more other embodiments of the presentinvention, any number and/or types of subclasses may be used.

In one or more embodiments of the present invention, Effector entity 264specializes in passing back outputs from the HTM network 260. Thoseskilled in the art will note that there may be any number of Effectorentities 264 in a net list defining the HTM network 260. The exactbehavior of Effector entity 264 (implemented as a base class) isextensible through the modification or addition of one or moresubclasses. For example, as shown in FIG. 22, Effector entity 264 hasthe following subclasses: an output file subclass 284; a motor controlsubclass 286; a database subclass 288; and a display subclass 290. Eachof these subclasses 284, 286, 288, 290 contains functionality specificto the type of each subclass 284, 286, 288, 290. In other words,Effector entity 264 may have no “knowledge” of the specificfunctionalities performed by each of its subclasses 284, 286, 288, 290.Further, although FIG. 22 shows a particular number and types ofsubclasses, in one or more other embodiments of the present invention,any number and/or types of subclasses may be used.

In one or more embodiments of the present invention, Link entity 266specializes in efficient message passing between particular entities.Those skilled in the art will note that there may be any number of Linkentities 266 in a net list defining the HTM network 260. The exactbehavior of Link entity 266 (implemented as a base class) is extensiblethrough the modification or addition of one or more subclasses.

In one or more embodiments of the present invention, Supervisor entity268 orchestrates the collective computation of the HTM network 260.Those skilled in the art will note that for a normal application, theremay be only one Supervisor entity 268 in a net list defining the HTMnetwork 260. The exact behavior of Supervisor entity 268 (implemented asa base class) is extensible through the modification or addition of oneor more subclasses.

In one or more embodiments of the present invention, Router entity 270specializes in accurately coordinating the passing of messages among theentities in an HTM network 260. Those skilled in the art will note thatthere may be a Router entity 270 for each computing entity (e.g., CPU)over which the HTM network 260 is running. The exact behavior of Routerentity 270 (implemented as a base class) is extensible through themodification or addition of one or more subclasses.

In one or more embodiments of the present invention, Learning andInference/Prediction entity 272 specializes in discovering and inferringcauses of sensed input patterns as described above. Those skilled in theart will note that there may be any number of Learning andInference/Prediction entities 272 in a net list defining the HTM network260. The exact behavior of Learning and Inference/Prediction entity 272(implemented as a base class) is extensible through the modification oraddition of one or more subclasses. For example, as shown in FIG. 22,Learning and Inference/Prediction entity 272 has the followingsubclasses: a coincidence detection subclass 292; a sequence learningsubclass 294; a belief propagation subclass 296; a prediction subclass298; and a vector quantization subclass 300. Each of these subclasses292, 294, 296, 298, 300 contains functionality specific to the type ofeach subclass 292, 294, 296, 298, 300. In other words, Learning andInference/Prediction entity 272 may have no “knowledge” of the specificfunctionalities performed by each of its subclasses 292, 294, 296, 298,300. Further, although FIG. 22 shows a particular number and types ofsubclasses, in one or more other embodiments of the present invention,any number and/or types of subclasses may be used.

In one or more embodiments of the present invention, when HTM network260 is running, an “outer” process may be running to “orchestrate” theoperation of the HTM network 260. FIG. 23 shows a flow process inaccordance with an embodiment of the present invention. Particularly,FIG. 23 shows a technique for traversing an HTM network. To providefurther context, as described above, an HTM network may have severalentities that are extensible. During operation of the HTM network, (i)various entities may attempt to extend one or more entities of the HTMnetwork and (ii) various entities will need to be processed. Thus, oneor more embodiments of the present invention provide a mechanism fortraversing the HTM network in some desirable manner with considerationto, for example, the priority and timing of particular entities.

In FIG. 23, initially, an HTM network is created ST310. This may beachieved by reading in a net list defining the HTM network. In one ormore other embodiments of the present invention, the HTM network may becreated programmatically. Once the HTM network itself has been createdin ST310, each entity in the HTM network is initialized (and stored inmemory) ST312.

Then, the priority of each entity may be optionally reset (noting thatthe priorities of each entity may already be reset immediately afterinitialization in ST312) ST314. Thereafter, the input parameters to theHTM network are set ST316. Then, the entity with the highest priority isdetermined ST318 and its compute( ) method is invoked ST320. Determiningthe entity with the highest priority may be dependent on one or moredifferent factors. For example, in some cases, a priority level of anentity may be used to determine the priority of that entity relative toother entities. However, in other cases, a timing of an entity may beused to determine the priority of that entity relative to otherentities. For example, if a compute( ) method of a particular entity hasto be invoked every x milliseconds, then at time intervals of xmilliseconds, that particular entity has the highest priority regardlessof the priority levels of other entities. More particularly, forexample, a sensor may be connected to a camera that needs to process alive image ever 33 milliseconds. In this case, a compute( ) method forthe sensor may be invoked every 33 milliseconds regardless of thepriority levels of other active entities. Those skilled in the art willnote that in such a manner, an HTM network may run in real-time.

Once all the entities in the HTM network have been processed ST322, theoutputs of the HTM network are read ST324. If more inputs remain ST326,then the process repeats optionally starting at ST314 (otherwiserepeating starting at ST316 (not shown)).

Further, in one or more embodiments of the present invention, theprocess described above with reference to FIG. 23 may be performed by orunder the direction of, for example, Supervisor entity 268 shown in FIG.22. In one or more embodiments of the present invention, Supervisorentity 268 may be “subclassed” if a different traversal mechanism isdesired.

An HTM network, as described above with reference to FIG. 22, enables,for example, a software developer, to “extend” the capabilities of theHTM network through the replacement and/or addition of subclasses.Moreover, with proper permission, a user may also modify the entity baseclasses in the net list defining the HTM network.

FIG. 24 shows a flow process in accordance with an embodiment of thepresent invention. Particularly, FIG. 24 shows how a user may extend anHTM network. Initially, a user may define/write a subclass for extendingthe HTM network in some way ST330. This subclass would include, forexample, a compute( ) method. Then, the source code for the HTM networkmay be recompiled ST332, thereby creating a new HTM network with thenewly defined subclass.

In some cases, however, it may not be desirable to recompile and/orprovide access to the source code for an entire HTM network.Accordingly, FIG. 25 shows a flow process for another way to extend anHTM network. Initially, a user creates a dynamic library as a plug-in,i.e., the new or modified subclass for the HTM network ST340. Then, theuser links, i.e., references in code, the plug-in to the HTM networkusing a plug-in interface/mechanism (e.g., Node Plug-in Interface 250shown in FIG. 21) of the HTM network (step not shown). This linking maybe dependent on binary code of the HTM network provided to the user.Thereafter, at start-up or while running, the HTM network maydynamically search for and then instantiate the plug-in ST342. Thoseskilled in the art will note that in such a manner, the HTM network isextended without having to recompile the source code for the entire HTMnetwork.

Message Passing

As described above, the operation of an HTM network may be executedacross a cluster of one or more servers. As further described above, inone or more embodiments of the present invention, NPUs manage theoperation of nodes forming the HTM network. Each NPU is responsible formanaging a certain set of one or more nodes. As further described belowwith reference to FIG. 26, one or more “message managers” may beinstantiated/implemented to facilitate the propagation of messageswithin a particular server and/or among two or more servers.

In FIG. 26, a cluster 350 is formed, at least in part, of servers 370,372, 374. NPUs 352, 354 are assigned to server 370, NPU 356 is assignedto server 372, and NPUs 358, 360, 362 are assigned to server 372.Further, as shown in FIG. 26, each NPU 350, 352, 354, 356, 358, 360, 362manages its own set of one or more nodes (shown, but not labeled), wherethe nodes collectively form all or part of an HTM network. Further, inone or more embodiments of the present invention, one or more of NPUs350, 352, 354, 356, 358, 360, 362 may be assigned (by, for example, anOS scheduler or a user) to run on particular CPUs. In such embodiments,the nodes of a particular NPU may be run by the CPU to which thatparticular NPU is assigned. Further, in one or more embodiments of thepresent invention, an NPU assigned to a particular CPU may bedynamically switched to run on a different CPU.

Further, those skilled in the art will note that although FIG. 26 showsparticular numbers of NPUs, servers, NPUs per server, total nodes, nodesper server, and nodes per NPU, in one or more other embodiments of thepresent invention, any configuration of servers, NPUs, and nodes may beused.

As described above, nodes in an HTM network output data (e.g., beliefs,matrices of values). Still referring to FIG. 26, in one or moreembodiments of the present invention, the propagation of such data asmessages between nodes, whether part of the same server or differentservers, may be handled by one or more message managers 364, 366, 368.For example, when a node managed by NPU 354 outputs a belief, the beliefis made available to message manager 364 (the availability of the beliefmay be notified to message manager 364 by NPU 354), which, based oninformation as to the source of the output belief and the topology ofthe HTM network running on cluster 350, sends the belief as part of amessage to each appropriate destination server (e.g., server 372). An“appropriate” destination server is a server running a node (or nodes)that requires the output belief. Those skilled in the art will note thatby implementing such message passing, data from one server needed orexpected by multiple nodes on another server may only be sent once asopposed to multiple times for each of the multiple destination nodes.This may result in the use of less bandwidth across the cluster 350.Further, in one or more embodiments of the present invention, it may notbe necessary for a message manager 364, 366, 368 on one server to beinformed of the local topology of another server.

As described above, a message manager 364, 366, 368 sends “inter-server”messages based on information regarding the topology of the HTM networkrunning across servers 370, 372, 374. This information may be specifiedto each message manager 364, 366, 368 by a Supervisor entity (e.g., 176in FIG. 18). Further, in one or more embodiments of the presentinvention, information (e.g., address tables) regarding the topology ofan HTM network may be formed dynamically without some central control.

Further, in one or more embodiments of the present invention, a messagemanager 364, 366, 368 of one server may communicate a message to amessage manager 364, 366, 368 of another server, which then communicatesthe message to a message manager 364, 366, 368 of yet another server.Such “relay” message passing may be used, for example, to improveperformance in a large-scale HTM-based system having many servers.

Further, in one or more embodiments of the present invention, messagemanagers 364, 366, 368 may implement one or more of any varioustransport protocols (e.g., using a Message Passing Interface (MPI) orvia a “zero-copy” protocol using shared memory).

Further, in one or more embodiments of the present invention, a messagemanager 364, 366, 368 may effectively send output data from a nodemanaged by a first NPU to a node managed by a second NPU that is on thesame server as the first NPU. Message managers 364, 366, 368 maycommunicate such “intra-server” messages using, for example, socketconnections and/or shared memory buffers.

Further, although FIG. 26 shows a one-to-one correspondence betweenservers 370, 372, 374 and message managers 364, 366, 368, in one or moreother embodiments of the present invention, any arrangement of serversand message managers may be used. For example, a particular server maynot have a message manager. Further, for example, a message manager forNPUs running on one server may run on a different server.

In one or more embodiments of the present invention, a message formed byany one of message managers 364, 366, 368 may include sub-messagesformed of a header portion and a data portion. The header portion maycontain, for example, a source and/or destination ID, message typeinformation, timing information, and/or a total data size of thesub-message. The data portion may contain, for example, the data itself.Further, in one or more embodiments of the present invention, asub-message may be formed of a fixed-size header portion and avariable-size data portion. Because the header portion may contain sizeand content information as to the data portion, a receiving messagemanager may proactively allocate the necessary resources to receive thedata portion. Further, in one or more embodiments of the presentinvention, the header and data portions may be transmitted overdifferent communication channels (e.g., TCP sockets) so that receipt ofthe data portion may be deferred until resources are available and whilenot blocking receipt of further header portions.

Further, in one or more embodiments of the present invention, a messagemanager 364, 366, 368 as described above with reference to FIG. 26 maybe related to, or otherwise associated with, a Router entity (e.g., 270in FIG. 22).

Further, in one or more embodiments of the present invention, one ormore of message managers 364, 366, 368 may ensure that messages routedthrough them are uncorrupted. Further, in one or more embodiments of thepresent invention, one or more of message managers 364, 366, 368 mayimplement lazy or proactive transmission algorithms. Further, in one ormore embodiments of the present invention, one or more of messagemanagers 364, 366, 368 may be used to profile an HTM network. Further,in one or more embodiments of the present invention, one or more ofmessage managers 364, 366, 368 may be used to observe network behaviorand/or monitor for performance issues. Further, in one or moreembodiments of the present invention, one or more of message managers364, 366, 368 may be used to detect and/or recover from faults. Further,in one or more embodiments of the present invention, one or more ofmessage managers 364, 366, 368 may be used to perform“quality-of-service” operations.

Further, in one or more embodiments of the present invention, one ormore of message managers 364, 366, 368 may have one or more messagebuffers. A message buffer of a message manager may be used to buffer allor parts of a received message (noting that the received message mayoriginate from a node local to (i.e., on the same server as) the routeror a node remote from (i.e., on a different server than) the router).Messages may be written to or read from a message buffer. Further, themessage buffer may be used to help synchronize message passing incluster 350. For example, a router having a message buffer may preventnode A from reading a message from its location in the message bufferwhile node B is writing to that location in the message buffer.

Further, an HTM in accordance with one or more embodiments of thepresent invention may be associated with virtually any type of computersystem, including multiprocessor and multithreaded uniprocessor systems,regardless of the platform being used. For example, as shown in FIG. 27,a networked computer system 200 includes at least one processor (e.g., ageneral-purpose processor, a field-programmable gate array (FPGA), anapplication-specific integrated circuit (ASIC), a graphics processor)202, associated memory 204, a storage device 206, and numerous otherelements (not shown) and functionalities typical of modern computersystems. The networked computer system 200 may also include input means(e.g., a keyboard 208, a mouse 210, one or more sensory input systems(not shown)) and output means (e.g., a monitor 212). The networkedcomputer system 200 is connected to a LAN or a wide area network (WAN)via a network interface connection (not shown). Those skilled in the artwill appreciate that these input and output means may take other forms.Further, those skilled in the art will appreciate that one or moreelements of the networked computer system 200 may be remotely locatedand connected to the other elements over a network. Further, softwareinstructions to perform one or more embodiments of the present inventionmay be stored on a computer readable medium such as a compact disc (CD),a diskette, a tape, a file, a hard drive, or any other computer-readablestorage device.

Advantages of the present invention may include one or more of thefollowing. In one or more embodiments of the present invention, anHTM-based system may learn causes.

In one or more embodiments of the present invention, an HTM-based systemmay determine one or more causes of patterns that may change over spaceand/or time.

In one or more embodiments of the present invention, an HTM-based systemmay identify patterns occurring frequently over time and then assignthem to one or more particular causes.

In one or more embodiments of the present invention, an HTM-based systemmay learn frequently occurring sequences and assign probabilitiesindicating the likelihood of elements in an input vector being part ofthe learned sequences.

In one or more embodiments of the present invention, an HTM-based systemmay assign spatially similar patterns to the same cause.

In one or more embodiments of the present invention, an HTM-based systemmay assign patterns received in order to the same cause.

In one or more embodiments of the present invention, an HTM-based systemmay learn timing between patterns in a received sequence.

In one or more embodiments of the present invention, an HTM-based systemmay assign patterns having no significant spatial overlap or timingrelationship to the same cause.

In one or more embodiments of the present invention, an HTM may infercauses through belief propagation.

In one or more embodiments of the present invention, a belief in onenode of an HTM may be used to inform a belief in another node of theHTM.

In one or more embodiments of the present invention, a belief in onenode of an HTM may be passed from a higher level node to a lower levelnode.

In one or more embodiments of the present invention, belief propagationin an HTM may enable a node in the HTM to form a belief that isoptimally and/or maximally consistent with the input to the node.

In one or more embodiments of the present invention, an HTM-based systemmay focus its determination of causes of input data on a subset of anentire input space, thereby possibly resulting in more efficient, lessintensive, and/or faster determination of causes of novel input.

In one or more embodiments of the present invention, an HTM-based systemmay focus its determination of causes of input data on a particularcategory (or set thereof) of causes, thereby possibly resulting in moreefficient, less intensive, and/or faster determination of causes ofinput data.

In one or more embodiments of the present invention, an HTM-based systemmay be used to create novel, complex, and goal-oriented behavior, wherethe behavior as a whole was not initially preprogrammed into theHTM-based system.

In one or more embodiments of the present invention, an HTM-based systemmay learn causes and form representations of behaviors caused bothoutside of and by the HTM-based system.

In one or more embodiments of the present invention, an HTM network maybe implemented across one or more CPUs and/or servers.

In one or more embodiments of the present invention, an HTM network maybe provided as a software platform that may be accessible in whole or inpart by one or more third parties.

In one or more embodiments of the present invention, an HTM networkimplemented across one or more CPUs may be accessible through acontrolled interface.

In one or more embodiments of the present invention, a functionality ofan HTM network may be extensible.

In one or more embodiments of the present invention, an HTM network maybe extended without recompiling source code for the entire HTM network.

In one or more embodiments of the present invention, various entitiesmay extend an HTM network, thereby potentially improving theapplicability, performance, speed, efficiency, robustness, and/oraccuracy of the HTM network.

In one or more embodiments of the present invention, an HTM network maybe extensible based on time, thereby providing for a real-time HTMnetwork.

In one or more embodiments of the present invention, messages betweennodes distributed across servers running all or part of an HTM networkmay be passed accurately and/or efficiently (e.g., using low relativelybandwidth).

In one or more embodiments of the present invention, one or more messagemanagers running in an HTM network may be provided with informationregarding the location of nodes in the HTM network. Such information maybe used to efficiently route messages between nodes in the HTM network.

In one or more embodiments of the present invention, an HTM-based systemis formed of a hierarchical network of nodes that may be used torepresent a hierarchical spatial and temporal structure of a world inwhich the HTM-based system is designed to operate.

While the invention has been described with respect to a limited numberof embodiments, those skilled in the art, having benefit of the abovedescription, will appreciate that other embodiments can be devised whichdo not depart from the scope of the invention as disclosed herein.Accordingly, the scope of the invention should be limited only by theattached claims.

1. A system, comprising: a hierarchy of computing modules configured tolearn a cause of input data sensed over space and time, the hierarchyfurther configured to determine a cause of novel sensed input datadependent on the learned cause, wherein the hierarchy is furtherconfigured to associate a first pattern in the input data and a secondpattern in the input data to a same possible cause of the input data. 2.The system of claim 1, wherein the hierarchy is further configured toassociate the first pattern and the second pattern to the same possiblecause dependent on a spatial similarity between the first pattern andthe second pattern.
 3. The system of claim 1, wherein the hierarchy isfurther configured to associate the first pattern and the second patternto the same possible cause dependent on a temporal relationship betweenthe first pattern and the second pattern.
 4. The system of claim 3,wherein the temporal relationship comprises an order in which the firstpattern and the second pattern are received in the hierarchy.
 5. Thesystem of claim 3, wherein the temporal relationship comprises a rhythmat which the first pattern and the second pattern are received in thehierarchy.
 6. The system of claim 3, wherein the temporal relationshipcomprises a tempo at which the first pattern and the second pattern arereceived in the hierarchy.
 7. The system of claim 1, wherein at leastone of the first pattern and the second pattern was previously learnedby the hierarchy.
 8. The system of claim 1, wherein the hierarchycomprises a first level of computing modules and a second level of atleast one computing module, wherein the first pattern and the secondpattern are received by at least one of the computing modules in thefirst level and are associated to the same possible cause dependent on acontrol signal from the computing module in the second level.
 9. Thesystem of claim 8, wherein the computing module in the second level hasan input range greater than an input range of the computing module inthe first level.
 10. The system of claim 1, wherein at least part of thehierarchy is implemented in at least one of software and hardware.
 11. Acomputer-implemented method of performing operations, comprising:learning a cause of a first set of input data received over space andtime by a hierarchy of computing modules, wherein the hierarchy iscapable of determining a cause of a second set of input data dependenton the learned cause, and wherein the learning comprises: associating afirst pattern in the first set of input data and a second pattern in thefirst set of input data to a same possible cause of the first set ofinput data.
 12. The computer-implemented method of claim 11, furthercomprising: associating the first pattern and the second pattern to thesame possible cause dependent on a spatial similarity between the firstpattern and the second pattern.
 13. The computer-implemented method ofclaim 11, further comprising: associating the first pattern and thesecond pattern to the same possible cause dependent on a temporalrelationship between the first pattern and the second pattern.
 14. Thecomputer-implemented method of claim 13, wherein the temporalrelationship comprises an order in which the first pattern and thesecond pattern are received in the hierarchy.
 15. Thecomputer-implemented method of claim 13, wherein the temporalrelationship comprises a rhythm at which the first pattern and thesecond pattern are received in the hierarchy.
 16. Thecomputer-implemented method of claim 13, wherein the temporalrelationship comprises a tempo at which the first pattern and the secondpattern are received in the hierarchy.
 17. The computer-implementedmethod of claim 11, wherein at least one of the first pattern and thesecond pattern was previously learned by the hierarchy.
 18. Thecomputer-implemented method of claim 11, wherein the hierarchy comprisesa first level of computing modules and a second level of at least onecomputing module, the method further comprising: receiving the firstpattern and the second pattern by at least one of the computing modulesin the first level; and associating the first pattern and the secondpattern to the same possible cause dependent on a control signalgenerated from the computing module in the second level.
 19. Acomputer-readable medium having instructions therein that are executableby a processor, the instructions comprising instructions to: learn acause of a first set of input data received over space and time by ahierarchy of computing modules, wherein the hierarchy is capable ofdetermining a cause of a second set of input data dependent on thelearned cause, and wherein the instructions to learn comprisesinstructions to: associate a first pattern in the first set of inputdata and a second pattern in the first set of input data to a samepossible cause of the first set of input data.
 20. The computer-readablemedium of claim 19, further comprising instructions to: associate thefirst pattern and the second pattern to the same possible causedependent on a spatial similarity between the first pattern and thesecond pattern.
 21. The computer-readable medium of claim 19, furthercomprising instructions to: associate the first pattern and the secondpattern to the same possible cause dependent on a temporal relationshipbetween the first pattern and the second pattern.
 22. Thecomputer-readable medium of claim 21, wherein the temporal relationshipcomprises an order in which the first pattern and the second pattern arereceived in the hierarchy.
 23. The computer-readable medium of claim 21,wherein the temporal relationship comprises a rhythm at which the firstpattern and the second pattern are received in the hierarchy.
 24. Thecomputer-readable medium of claim 21, wherein the temporal relationshipcomprises a tempo at which the first pattern and the second pattern arereceived in the hierarchy.
 25. The computer-readable medium of claim 19,wherein at least one of the first pattern and the second pattern waspreviously learned by the hierarchy.
 26. The computer-readable medium ofclaim 19, wherein the hierarchy comprises a first level of computingmodules and a second level of at least one computing module, theinstructions further comprising instructions to: receive the firstpattern and the second pattern by at least one of the computing modulesin the first level; and associate the first pattern and the secondpattern to the same possible cause dependent on a control signalgenerated from the computing module in the second level.